Semantic Grep: Regular Expressions + Relational Abstraction

نویسندگان

  • R. Ian Bull
  • Andrew Trevors
  • Andrew J. Malton
  • Michael W. Godfrey
چکیده

Searching source code is one of the most common activities of software engineers. Text editors and other support tools normally provide searching based on lexical expressions (regular expressions). Some more advanced editors provide a way to add semantic direction to some of the searches. Recent research has focused on advancing the semantic options available to text-based queries. Most of these results make use of heavy weight relational database management technology. In this paper we explore the extension of lexical pattern matching by means of light weight relational queries, implemented using a tool called grok. A “semantic grep” (sgrep) command was implemented, which translates queries in a mixed algebraic and lexical language into a combination of grok queries and grep commands. This paper presents the design decisions behind sgrep, and example queries that can be posed. The paper concludes with a case study in which sgrep was used to identify architectural anomalies in PostgreSQL, an open source Database Management System.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Survey of Global Regular Expression Print ( GREP ) Tools

The UNIX grep utility marked the birth of a global regular expression print (GREP) tools. Searching for patterns in text is important operation in a number of domains, including program comprehension and software maintenance, structured text databases, indexing file systems, and searching natural language texts. Such a wide range of uses inspired the development of variations of the original UN...

متن کامل

Awk-A Pattern Scanning and Processing Language

Command Syntax: awk [-F delim] [-f pgmfile or 'command str'] inputfile awk processes its input one line at a time, applying commands to the line when it matches the pattern associated with the command. Each input line is broken up into fields called $1, $2, …, based on the current value of the FS (field separator) variable. The awk program consists of one or more patterns on separate lines or s...

متن کامل

Biological sequence analysis using regular expressions.

“Regular expressions”, also known as “RegExps” or sometimes as “grep patterns”, are a way of specifying patterns of characters within a text file or longer string of characters. Regular expressions can contain various “wild cards” or sets of alternatives, which can be used to include ambiguity in the pattern to be matched. One common use is to perform sophisticated find-and-replace operations.

متن کامل

Using Semantic Unification to Generate Regular Expressions from Natural Language

We consider the problem of translating natural language text queries into regular expressions which represent their meaning. The mismatch in the level of abstraction between the natural language representation and the regular expression representation make this a novel and challenging problem. However, a given regular expression can be written in many semantically equivalent forms, and we explo...

متن کامل

NR-grep: a fast and flexible pattern-matching tool

We present nrgrep (\nondeterministic reverse grep"), a new pattern matching tool designed for eecient search of complex patterns. Unlike previous tools of the grep family, such as agrep and Gnu grep, nrgrep is based on a single and uniform concept: the bit-parallel simulation of a nondeterministic suux automaton. As a result, nrgrep can nd from simple patterns to regular expressions, exactly or...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2002